package cn.gok.server.controller;

import cn.gok.common.config.SystemLog;
import cn.gok.common.entity.customer.CustomerLoginLog;
import cn.gok.common.resp.PageResult;
import cn.gok.server.service.CustomerLoginLogService;
import cn.gok.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: DxlinY
 * @apiNote: 登录日志控制层
 * @date: 2020/11/7
 * @time: 10:25
 */
@RestController
@RequestMapping("/memberRecordLogin")
public class CustomerLoginLogController {

    @Autowired
    private CustomerLoginLogService customerLoginLogService;

    /**
     * 登录日志分页分页
     *
     * @param page             页数
     * @param limit            页容量
     * @param customerLoginLog 条件查询对象
     * @return pageResult
     */
    @PostMapping("/page")
    @SystemLog(model = "登录日志", method = "分页")
    public PageResult page(int page, int limit, CustomerLoginLog customerLoginLog) {
        return ResultUtil.pageInfo(customerLoginLogService.listAll(page, limit, customerLoginLog));
    }
}
